//
//  ViewController.m
//  runtime
//
//  Created by soulghost on 6/1/2016.
//  Copyright © 2016 soulghost. All rights reserved.
//

#import "ViewController.h"
#import "DKNightVersion.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 120, 40)];
    btn.tintColor = [UIColor blueColor];
    [btn setTitle:@"Clcik" forState:UIControlStateNormal];
    [btn setTitle:@"Clicked" forState:UIControlStateHighlighted];
    [self.view addSubview:btn];
    btn.backgroundColor = [UIColor redColor];
    [btn dk_setTitleColorPicker:DKColorWithColors([UIColor blueColor], [UIColor whiteColor]) forState:UIControlStateNormal];

    [btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    self.view.dk_backgroundColorPicker = DKColorWithRGB(0xffffff, 0x343434);
    self.view.dk_tintColorPicker = DKColorWithColors([UIColor blueColor], [UIColor purpleColor]);
    
//    NSString *filePath = @"/Users/soulghost/Desktop/Resources/十面埋伏-技能-爱给网/";
//    NSFileManager *mgr = [NSFileManager defaultManager];
//    NSArray<NSString *> *pathes = [mgr contentsOfDirectoryAtPath:filePath error:nil];
//    for (int i = 0; i < pathes.count; i++) {
//        NSString *fileName = pathes[i];
//        if ([fileName hasPrefix:@"zs_skill"]) {
//            NSRange range = [fileName rangeOfString:@"zs_skill_"];
//            NSString *sub = [fileName substringFromIndex:range.location + range.length];
//            NSLog(@"%@",sub);
//            NSString *newName = [NSString stringWithFormat:@"skill_icon_%@",sub];
//            [mgr moveItemAtPath:[filePath stringByAppendingPathComponent:fileName] toPath:[filePath stringByAppendingPathComponent:newName] error:nil];
//        }
//    }
    

}

- (void)click{
    if ([DKNightVersionManager currentThemeVersion] == DKThemeVersionNight) {
        [DKNightVersionManager dawnComing];
    } else {
        [DKNightVersionManager nightFalling];
    }
}

@end
